import torch
import matplotlib.pyplot as plt
import torch.nn as nn
import torch.nn.functional as F


def ReLU(x) -> list:
    x = x.numpy()
    y = []
    for v in x:
        if v <= 0:
            y.append(0)
        else:
            y.append(v)
    return y



def Curve(x):
    y = ReLU(x)

    plt.title('ReLU')
    plt.plot(x, y, color='blue', label='ReLU')
    plt.legend()
    plt.grid(True, linestyle='--', alpha=0.8)

    plt.xlabel('x')
    plt.ylabel('y')
    plt.show()


if __name__ == '__main__':
    x = torch.linspace(-10, 10, 10000)
    Curve(x)
